package com.wsd.smartcarwasher.service;

import com.wsd.smartcarwasher.dao.SubTextDao;
import com.wsd.smartcarwasher.domain.SubText;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

@Service
public class SubTextService {

    @Resource
    private SubTextDao subTextDao;
    public List<SubText> AboutUs() {
        return subTextDao.getByType(0);
    }

    public List<SubText> washCarTips() {
        return subTextDao.getByType(1);
    }


    public List<SubText>  getProblem() {
        return subTextDao.getByType(2);
    }


    public List<SubText> getAll() {
        List<SubText> subTextList=subTextDao.getAll();
        return subTextList;
    }

    public int add(SubText sub) {

        return subTextDao.insert(sub);
    }

    public int update(SubText sub) {

        return subTextDao.updateByPrimaryKeySelective(sub);
    }

    public int delete(String id) {
        return subTextDao.delete(id);
    }

    public List<SubText> partnerRight() {
        return subTextDao.getByType(3);
    }
}
